﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

public static class PrefLoader
{
    private static Dictionary<string, string> keys;

    static PrefLoader()
    {
        keys = new Dictionary<string, string>();

        StreamReader sr = new StreamReader(File.Open("prefs.txt", FileMode.Open));
        while (!sr.EndOfStream)
        {
            string line = sr.ReadLine();
            string[] tokens = line.Split(new char[] { '=' }, 2);

            try
            {
                keys.Add(tokens[0], tokens[1]);
            }
            catch { }
        }
    }

    public static int GetInt(string key)
    {
        return int.Parse(keys[key]);
    }

    public static string GetString(string key)
    {
        return keys[key];
    }
}
